package behavior.chain;

/**
 * @author dali
 * @date 2021-07-29 13:17
 * @Description
 */

public class DeptHandler implements Handler {
    private Handler handler;

    @Override
    public void setNextHandler(Handler handler) {
        this.handler = handler;
    }

    @Override
    public boolean handler(int day) {
        if (day < 7) {
            System.out.println("部门领导批了");
            return true;
        }
        System.out.println("请假天数过长，交给上级领导审批...");
        return handler == null ? false : handler.handler(day);
    }
}
